package com.partsoft.dits.anns;

public enum ConcatenationType {
	
	Parent("父级消息", 0),

	Child("子级消息", 1);

	private int code;

	private String title;

	private ConcatenationType(String title, int code) {
		this.title = title;
		this.code = code;
	}

	public String getTitle() {
		return title;
	}

	public int getCode() {
		return code;
	}

	public static ConcatenationType fromName(String name) {
		for (ConcatenationType type : ConcatenationType.values()) {
			if (type.name().equals(name))
				return type;
		}
		return null;
	}

	public static ConcatenationType fromCode(int code) {
		for (ConcatenationType type : ConcatenationType.values()) {
			if (type.code == code)
				return type;
		}
		return null;
	}

}
